import request from '@/utils/request'

// job
export function banUser (data) {
  return request({
    url: '/user/trend',
    method: 'put',
    data
  })
}
export function banUserAtReport (data) {
  return request({
    url: '/report/trend',
    method: 'put',
    data
  })
}


export function uploadProducts (data) {
  return request({
    url: '/upload/products',
    method: 'post',
    data
  })
}


export function listCategories (params) {
  return request({
    url: '/goods/classify',
    method: 'get',
    params
  })
}

export function createCategory (data) {
  return request({
    url: '/goods/classify',
    method: 'post',
    data
  })
}


export function updateCategory (data) {
  return request({
    url: '/goods/classify',
    method: 'put',
    data
  })
}


export function addRobot (data) {
  return request({
    url: '/user/robot',
    method: 'post',
    data
  })
}


export function createProduct (data) {
  return request({
    url: '/goods',
    method: 'post',
    data
  })
}

export function updateProduct (data) {
  return request({
    url: '/goods',
    method: 'put',
    data
  })
}


export function listSysProps (params) {
  return request({
    url: '/sys/prop',
    method: 'get',
    params
  })
}

export function addUpgrade (data) {
  return request({
    url: '/upgrade',
    method: 'post',
    data
  })
}

export function updateUpgrade (data) {
  return request({
    url: '/upgrade',
    method: 'put',
    data
  })
}

export function deleteUpgrade (id) {
  return request({
    url: '/upgrade/' + id,
    method: 'delete'
  })
}

export function addBanner (data) {
  return request({
    url: '/banner',
    method: 'post',
    data
  })
}

export function updateBanner (data) {
  return request({
    url: '/banner',
    method: 'put',
    data
  })
}

export function goodsSaleTrend (data) {
  return request({
    url: '/goods/sale/trend',
    method: 'put',
    data
  })
}

export function orderTrend (data) {
  return request({
    url: '/order/trend',
    method: 'put',
    data
  })
}

export function orderDetail (orderId) {
  return request({
    url: '/order/' + orderId,
    method: 'get',
  })
}

export function addMerchant (data) {
  return request({
    url: '/goods/merchant',
    method: 'post',
    data
  })
}

export function updateMerchant (data) {
  return request({
    url: '/goods/merchant',
    method: 'put',
    data
  })
}

export function listMerchant (params) {
  return request({
    url: '/goods/merchant',
    method: 'get',
    params
  })
}


export function authMerchantTrend (data) {
  return request({
    url: '/auth/merchant/trend',
    method: 'put',
    data
  })
}

export function authPersonalTrend (data) {
  return request({
    url: '/auth/personal/trend',
    method: 'put',
    data
  })
}

export function addDrawLotteryData (data) {
  return request({
    url: '/draw',
    method: 'post',
    data
  })
}

export function updateDrawLotteryData (data) {
  return request({
    url: '/draw',
    method: 'put',
    data
  })
}


// 2022/07/11
// poptown 最新api

// POST /recharge/supplement/preview
// 用户资产预调整
export function addSupplementPreview (data) {
  return request({
    url: '/recharge/supplement/preview',
    method: 'post',
    data
  })
}

// POST /recharge/supplement/confirm
// 用户资产调整确认
export function addSupplementConfirm (data) {
  return request({
    url: '/recharge/supplement/confirm',
    method: 'post',
    data
  })
}

// POST /goods/airdrop
// 藏品空投
export function addGoodsAirDrop (data) {
  return request({
    url: '/goods/airdrop',
    method: 'post',
    data
  })
}

// 固定tokenId 空投
export function addTokenIdAirDrop (data) {
  return request({
    url: '/goods/airdrop/fixed',
    method: 'post',
    data
  })
}

// 数字头像列表
export function avatarListApi (params) {
  return request({
    url: '/avatar/list',
    method: 'get',
    params
  })
}

// 数字头像空投
export function addDropAvatarApi (data) {
  return request({
    url: '/avatar/airdrop',
    method: 'post',
    data
  })
}
